<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Meta Tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="wpoceans">
    <!-- Page Title -->
    <title>Varaus</title>
    <!-- Icon fonts -->
    <link href="${pageContext.request.contextPath}/css/themify-icons.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/flaticon.css" rel="stylesheet">
    <!-- Bootstrap core CSS -->
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <!-- Plugins for this template -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/commentstyle.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/comment.css">
    <link href="${pageContext.request.contextPath}/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/owl.carousel.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/owl.theme.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/slick.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/slick-theme.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/odometer-theme-default.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/owl.transitions.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/jquery.fancybox.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/magnific-popup.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/nice-select.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/bootstrap-datepicker.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body id="home">
    <!-- start page-wrapper -->
    <div class="page-wrapper">
        <!-- start preloader -->
        <div class="preloader">
            <div class="spinner">
                <div class="bounce1"></div>
                <div class="bounce2"></div>
                <div class="bounce3"></div>
            </div>
        </div>
        <!-- end preloader -->
        <!-- Start header -->
        <header id="header" class="site-header header-style-2">
            <nav class="navigation navbar navbar-default">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button type="button" class="open-btn">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="index.html"><img src="${pageContext.request.contextPath}/images/logo-2.png" alt=""></a>
                    </div>
                    <div id="navbar" class="navbar-collapse collapse navigation-holder">
                        <button class="close-navbar"><i class="ti-close"></i></button>
                        <ul class="nav navbar-nav">
                            <li class="menu-item-has-children">
                            <li><a href="${pageContext.request.contextPath}/index.jsp">首页</a></li>
                            </li>
                            <li class="menu-item-has-children">
                            <li><a href="${pageContext.request.contextPath}/frontController/allRoom">全部房间</a></li>
                            </li>
                            <li class="menu-item-has-children">
                            <li><a href="${pageContext.request.contextPath}/frontController/roomSingle">房间详情</a></li>
                            </li>
                            <li class="menu-item-has-children">
                            <li><a href="${pageContext.request.contextPath}/frontController/service">酒店服务</a></li>
                            </li>
                        </ul>
                    </div><!-- end of nav-collapse -->
                    <div class="cart-search-contact">
                        <div class="get-quote">
                            <a href="#"><i class="fi flaticon-support-1"></i>Call : +0123-456-789</a>
                        </div>
                        <c:if test="${sessionScope.user == null}">
                            <div class="header-search-form-wrapper">
                                <a href="${pageContext.request.contextPath}/userInfoController/login"><button class="theme-btn-s2">登录</button></a>
                            </div>
                            <div class="header-search-form-wrapper">
                                <a href="${pageContext.request.contextPath}/userInfoController/login"><button class="theme-btn-s2">注册</button></a>
                            </div>
                        </c:if>
                        <c:if test="${sessionScope.user != null}">
                            <button class="theme-btn-s2">
                                <!-- 这儿放头像 -->
                                <!-- 默认头像 -->
                                <c:if test="${sessionScope.user.userImg ==null}">
                                    <img id='uimg' src="#"/>
                                </c:if>
                                <!-- 自定义头像 -->
                                <c:if test="${sessionScope.user.userImg !=null}">
                                    <img id='uimg'   src="${pageContext.request.contextPath }/DownLoadController/download/?filename=${sessionScope.user.userImg}" />
                                </c:if>
                            </button>
                            <button class="theme-btn-s2" style="background-color: rgb(17,70,130);">${sessionScope.user.userName}</button>
                            <a href="${pageContext.request.contextPath}/frontController/userCenter"><button class="theme-btn-s2" style="background-color: rgb(17,70,130);">资料</button></a>
                            <a href="${pageContext.request.contextPath}/userInfoController/exit"><button class="theme-btn-s2" style="background-color: rgb(17,70,130);">退出</button></a>
                        </c:if>
                    </div>
                </div><!-- end of container -->
            </nav>
        </header>
        <!-- 头部结束 -->
        <!-- start page-title -->
        <section class="page-title">
            <div class="container">
                <div class="row">
                    <div class="col col-xs-12">
                        <h2>${requestScope.roomType.rtName}</h2>
                        <p id="rtName" style="display: none">${requestScope.roomType.rtName}</p>
                        <p id="userName" style="display: none">${sessionScope.user.userName}</p>
                        <ol class="breadcrumb">
                            <li><a href="${pageContext.request.contextPath}/index.jsp">首页</a></li>
                            <li>房间详情</li>
                        </ol>
                    </div>
                </div> <!-- end row -->
            </div> <!-- end container -->
        </section>
        <!-- end page-title -->
        <!-- 房间基本信息部分开始 -->
        <div class="wpo-select-section-3">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="wpo-select-wrap">
                            <div class="wpo-select-area">
                                <form class="clearfix">
                                    <div class="select-sub">
                                        <span>床位</span>
                                        <h2>${requestScope.roomType.rtBed}</h2>
                                    </div>
                                    <div class="select-sub">
                                        <span>人数</span>
                                        <h2>${requestScope.roomType.rtBed * 2}</h2>
                                    </div>
                                    <div class="select-sub">
                                        <span>设施</span>
                                        <h2>有窗</h2>
                                    </div>
                                    <div class="select-sub">
                                        <span>是否钟点房</span>
                                        <h2>${requestScope.roomType.rtClRoom}</h2>
                                    </div>
                                    <div class="select-sub">
                                        <h5>价钱 <span>${requestScope.roomType.rtPrice}</span> / 夜</h5>
                                        <a href="${pageContext.request.contextPath}/PayController/doPay">
                                            <span class="theme-btn-s2">去预定</span>
                                            <%--<button class="theme-btn-s2" onclick="return false">去预定</button>--%>
                                        </a>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 房间基本信息部分结束 -->
        <!-- 房间内景图片开始-->
        <div class="room-slide-area section-padding">
            <div class="Room-carousel owl-carousel owl-theme owl-btn-center-lr owl-dots-primary-full owl-btn-3 m-b30 wow fadeIn" data-wow-duration="2s" data-wow-delay="0.2s">
                <div class="item">
                    <div class="destination-item">
                        <div class="destination-img">
                            <img src="${pageContext.request.contextPath}/images/room/img-4.jpg" alt="">
                        </div>
                    </div>
                </div>
                <div class="item">
                    <div class="destination-item">
                        <div class="destination-img">
                            <img src="${pageContext.request.contextPath}/images/room/img-5.jpg" alt="">
                        </div>
                    </div>
                </div>
                <div class="item">
                    <div class="destination-item">
                        <div class="destination-img">
                            <img src="${pageContext.request.contextPath}/images/room/img-6.jpg" alt="">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 房间内景图片结束-->
        <!-- 房间详情开始 -->
        <div class="Room-details-area">
            <div class="container">
                <div class="row">
                    <div class="col-md-10 col-md-offset-1">
                        <div class="room-description">
                            <div class="room-title">
                                <h2>备注</h2>
                            </div>
                            <p class="p-wrap">${requestScope.roomType.rtRemark}</p>
                        </div>
                        <!-- 房间服务部分开始 -->
                        <div class="room-details-service">
                            <div class="row">
                                <div class="room-details-item">
                                    <div class="row">
                                        <div class="col-md-5 col-sm-5">
                                            <div class="room-d-text">
                                                <div class="room-title">
                                                    <h2>便利设施</h2>
                                                </div>
                                                <ul>
                                                    <li><a href="#">空调</a></li>
                                                    <li><a href="#">WI-FI</a></li>
                                                    <li><a href="#">淋浴</a></li>
                                                    <li><a href="#">洗漱用品</a></li>
                                                    <li><a href="#">智能电视</a></li>
                                                    <li><a href="#">电热吹风</a></li>
                                                    <li><a href="#">窗户</a></li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="col-md-7 col-sm-7">
                                            <div class="room-d-img">
                                                <img src="${pageContext.request.contextPath}/images/room/img-7.jpg" alt="">
                                            </div>
                                        </div>
                                        <div class="col-md-7">
                                            <div class="room-d-img">
                                                <img src="${pageContext.request.contextPath}/images/room/img-8.jpg" alt="">
                                            </div>
                                        </div>
                                        <div class="col-md-5">
                                            <div class="room-d-text">
                                                <div class="room-title">
                                                    <h2>房间服务</h2>
                                                </div>
                                                <ul>
                                                    <li><a href="#">日常清洁</a></li>
                                                    <li><a href="#">游泳池</a></li>
                                                    <li><a href="#">免费停车场</a></li>
                                                    <li><a href="#">免费早餐 </a></li>
                                                    <li><a href="#">免费WI-FI</a></li>
                                                    <li><a href="#">电梯</a></li>
                                                    <li><a href="#">其他服务</a></li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- 房间服务部分结束 -->
                        
                        <!-- 其他评论部分开始 -->
                        <div class="room-review">
                            <div class="room-title">
                                <h2>用户评论</h2>

                                <div class="commentAll">
                                    <!--评论区域 begin-->
                                    <div class="reviewArea clearfix">
                                        <textarea class="content comment-input" placeholder="欢迎光临,来评价一下吧;" onkeyup="keyUP(this)"></textarea>
                                        <a href="javascript:;" class="plBtn">评论</a>
                                    </div>
                                    <!--评论区域 end-->
                                    <!--回复区域 begin-->
                                    <div class="comment-show" id="comment-show">

                                    </div>
                                    <!--回复区域 end-->
                                </div>

                            </div>
                        </div>
                        <!-- 其他评论部分结束 -->
                        
                        <!-- 发表评论开始 -->
                        <div class="add-review">
                            <div class="wpo-blog-single-section">
                                <!-- 其他房间开始 不要也行-->
                                <div class="other-room">
                                    <div class="Room-section">
                                        <div class="container">
                                            <div class="col-12">
                                                <div class="room-title">
                                                    <h2>其他房间</h2>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col col-xs-12 sortable-gallery" >
                                                    	<!-- 其他房间展示开始  -->
                                                    <div class="gallery-container gallery-fancybox masonry-gallery" id="otherRoomType">

                                                        <!-- 其他房间展示结束 -->
                                                    </div>
                                                </div>
                                            </div> <!-- end row -->
                                        </div>
                                    </div>
                                </div>
                                <!-- 其他房间结束 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 房间详情部分结束 -->
        
        <!-- start wpo-site-footer -->
        <footer class="wpo-site-footer">
            <div class="wpo-upper-footer">
                <div class="wpo-footer-top">
                    <div class="container">
                        <div class="row">
                            <div class="col-lg-6 col-md-6 col-sm-6 col-12 custom-grid">
                                <div class="logo widget-title">
                                    <img src="${pageContext.request.contextPath}/images/logo.png" alt="blog">
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-12 custom-grid">
                                <ul>
                                    <li><a href="#"><i class="ti-facebook"></i></a></li>
                                    <li><a href="#"><i class="ti-twitter-alt"></i></a></li>
                                    <li><a href="#"><i class="ti-instagram"></i></a></li>
                                    <li><a href="#"><i class="ti-google"></i></a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="footer-middle">
                    <div class="container">
                        <div class="row">
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget market-widget wpo-service-link-widget">
                                    <div class="widget-title">
                                        <h3>Contact </h3>
                                    </div>
                                    <p>online store with lots of cool and exclusive features</p>
                                    <div class="contact-ft">
                                        <ul>
                                            <li><i class="fi ti-location-pin"></i>28 Street, New York City, USA</li>
                                            <li><i class="fi ti-mobile"></i>+000123456789</li>
                                            <li><i class="fi flaticon-email"></i>Hastium@gmail.com</li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget link-widget resource-widget">
                                    <div class="widget-title">
                                        <h3>Destination</h3>
                                    </div>
                                    <div class="news-wrap">
                                        <div class="news-img">
                                            <img src="${pageContext.request.contextPath}/images/footer/img-1.jpg" alt="">
                                        </div>
                                        <div class="news-text">
                                            <h3>Paris, France</h3>
                                            <span>11 Jun 2020 - 22 Jun 2020</span>
                                            <h2>$835</h2>
                                        </div>
                                    </div>
                                    <div class="news-wrap">
                                        <div class="news-img">
                                            <img src="${pageContext.request.contextPath}/images/footer/img-2.jpg" alt="">
                                        </div>
                                        <div class="news-text">
                                            <h3>San Francisco</h3>
                                            <span>11 Jun 2020 - 22 Jun 2020</span>
                                            <h2>$835</h2>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget link-widget">
                                    <div class="widget-title">
                                        <h3>Useful Links</h3>
                                    </div>
                                    <ul>
                                        <li><a href="room.jsp">Our Offers</a></li>
                                        <li><a href="service.jsp">How Spread</a></li>
                                        <li><a href="userCenter.jsp">Our Event</a></li>
                                    </ul>
                                </div>
                            </div>
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget newsletter-widget">
                                    <div class="widget-title">
                                        <h3>Newsletter</h3>
                                    </div>
                                    <form>
                                        <div class="input-1">
                                            <input type="email" class="form-control" placeholder="Email Address *" required="">
                                        </div>
                                        <div class="submit clearfix">
                                            <button type="submit">subscribe<i class="ti-angle-right"></i></button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div> <!-- end container -->
                </div>
            </div>
            <div class="wpo-lower-footer">
                <div class="container">
                    <div class="row">
                        <div class="col col-md-6 col-sm-6">
                            <div class="term">
                                <ul>
                                    <li><a href="#">Privecy Policy</a></li>
                                    <li><a href="#">Terms & Condition</a></li>
                                    <li><a href="#">Cookies</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="col col-md-6 col-sm-6">
                            <p class="copyright">Copyright &copy; 2020.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
                        </div>
                    </div>
                </div>
            </div>
        </footer>
        <!-- end wpo-site-footer -->
    </div>
    <!-- All JavaScript files
    ================================================== -->
    <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/owl.carousel.min.js"></script>
    <!-- Plugins for this template -->
    <script src="${pageContext.request.contextPath}/js/jquery-plugin-collection.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap-datepicker.min.js"></script>
    <!-- Custom script for this template -->
    <script src="${pageContext.request.contextPath}/js/script.js"></script>
</body>
<script type="text/javascript">
    $(function () {
        //发送ajax请求 获取评论
        $.ajax({
            url:"${pageContext.request.contextPath}/comments/queryRtComment",
            type:"GET",
            dataType:"json",
            success:function(data){
                for(var i=0;i<data.length;i++){
                    $("#comment-show").append("<div class=\"comment-show-con clearfix\">\n" +
                        "                                            <div class=\"comment-show-con-img pull-left\"><img src=\"${pageContext.request.contextPath }/DownLoadController/download/?filename="+data[i].user.userImg+"\" alt=\"\"></div>\n" +
                        "                                            <div class=\"comment-show-con-list pull-left clearfix\">\n" +
                        "                                                <div class=\"pl-text clearfix\">\n" +
                        "                                                    <a href=\"#\" class=\"comment-size-name\">"+data[i].user.userName+": </a>\n" +
                        "                                                    <span class=\"my-pl-con\">&nbsp;"+data[i].comText+"!</span>\n" +
                        "                                                </div>\n" +
                        "                                                <div class=\"date-dz\">\n" +
                        "                                                    <p id='comId' style='display: none'>"+data[i].comId+"</p><span class=\"date-dz-left pull-left comment-time\">"+data[i].comDate+"</span>\n" +
                        "                                                    <div class=\"date-dz-right pull-right comment-pl-block\">\n" +
                        "                                                        <a href=\"javascript:;\" class=\"date-dz-pl pl-hf hf-con-block pull-left\">回复</a>\n" +
                        "                                                    </div>\n" +
                        "                                                </div>\n" +
                        "                                                <div class=\"hf-list-con\">"+two(data[i].list)+"</div>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    ")
                }

            }
        })
        //发送ajax请求 获取其他房间
        /*$.ajax({
            url:"/RoomTypeController/queryOtherRoomType",
            type:"GET",
            data:{rtName:$("#rtName").text()},
            dataType:"json",
            success:function(data){
                for(var i=0;i<data.length;i++){
                    $("#otherRoomType").append("<div class=\"grid\">\n" +
                        "           <div class=\"room-item\">\n" +
                        "                <img src=\"/images/room/img-1.jpg\" alt class=\"img img-responsive\">\n" +
                        "                <div class=\"room-text-show\">\n" +
                        "                      <h2>"+data[i].rtName+"</h2>\n" +
                        "                </div>\n" +
                        "                <div class=\"room-text-hide\">\n" +
                        "                      <h2>"+data[i].rtName+"</h2>\n" +
                        "                      <p>"+data[i].rtRemark+"</p>\n" +
                        "                       <small>价格: <span>"+data[i].rtPrice+"</span> / 晚</small>\n" +
                        "                      <a class=\"theme-btn-s2\" href=\"/frontController/roomSingle?rtName="+data[i].rtName+"\">了解更多</a>\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "        </div>\n")
                }

            }
        })*/
    })
    function two(list) {
        var content2 = "";
        //遍历
        $.each(list, function(index, obj) {
                    content2 += "<div class=\"comment-show-con clearfix\"><div class=\"comment-show-con-img pull-left\"><img src='${pageContext.request.contextPath }/DownLoadController/download/?filename="+obj.user.userImg+"' alt=\"\"></div> <div class=\"comment-show-con-list pull-left clearfix\"><div class=\"pl-text clearfix\"> <a href=\"#\" class=\"comment-size-name\">"+obj.user.userName+": </a> <span class=\"my-pl-con\">&nbsp;"+obj.com2Text+"</span> </div> <div class=\"date-dz\"> <span class=\"date-dz-left pull-left comment-time\">"+obj.com2Date+"</span> <div class=\"date-dz-right pull-right comment-pl-block\"> <a href=\"javascript:;\" class=\"date-dz-pl pl-hf hf-con-block pull-left\">回复</a> </div> </div><div class=\"hf-list-con\"></div></div> </div>";
                })
        return content2;
    }
</script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.flexText.js"></script>
<!--textarea高度自适应-->
<script type="text/javascript">
    $(function () {
        $('.content').flexText();
    });
</script>
<!--textarea限制字数-->
<script type="text/javascript">
    function keyUP(t){
        var len = $(t).val().length;
        if(len > 139){
            $(t).val($(t).val().substring(0,140));
        }
    }
</script>
<!--点击评论创建评论条-->
<script type="text/javascript">
    $('.commentAll').on('click','.plBtn',function(){
        var myDate = new Date();
        //获取当前年
        var year=myDate.getFullYear();
        //获取当前月
        var month=myDate.getMonth()+1;
        //获取当前日
        var date=myDate.getDate();
        var h=myDate.getHours();       //获取当前小时数(0-23)
        var m=myDate.getMinutes();     //获取当前分钟数(0-59)
        if(m<10) m = '0' + m;
        var s=myDate.getSeconds();
        if(s<10) s = '0' + s;
        var now=year+'-'+month+"-"+date+" "+h+':'+m+":"+s;
        //获取输入内容
        var oSize = $(this).siblings('.flex-text-wrap').find('.comment-input').val();
        console.log(oSize);
        //动态创建评论模块
        oHtml = '<div class="comment-show-con clearfix"><div class="comment-show-con-img pull-left"><img src="${pageContext.request.contextPath }/DownLoadController/download/?filename=${sessionScope.user.userImg}" alt=""></div> <div class="comment-show-con-list pull-left clearfix"><div class="pl-text clearfix"> <a href="#" class="comment-size-name">${sessionScope.user.userName} : </a> <span class="my-pl-con">&nbsp;'+ oSize +'</span> </div> <div class="date-dz"> <span class="date-dz-left pull-left comment-time">'+now+'</span> <div class="date-dz-right pull-right comment-pl-block"><a href="javascript:;" class="removeBlock">删除</a> <a href="javascript:;" class="date-dz-pl pl-hf hf-con-block pull-left">回复</a> </div> </div><div class="hf-list-con"></div></div> </div>';
        if(oSize.replace(/(^\s*)|(\s*$)/g, "") != ''){
            $(this).parents('.reviewArea ').siblings('.comment-show').prepend(oHtml);
            $(this).siblings('.flex-text-wrap').find('.comment-input').prop('value','').siblings('pre').find('span').text('');
        }
        var userName = $("#userName").text();
        console.log(userName)
        var comments = {
            "comText": oSize,
            "comDate":now,
        }
        $.ajax({
            url:"${pageContext.request.contextPath}/comments/addCom",
            type:"GET",
            data:{comments:JSON.stringify(comments),userName:userName },
            dataType:"json",
        })
    });
</script>
<!--点击回复动态创建回复块-->
<script type="text/javascript">
    $('.comment-show').on('click','.pl-hf',function(){
        //获取回复人的名字
        var fhName = $(this).parents('.date-dz-right').parents('.date-dz').siblings('.pl-text').find('.comment-size-name').html();
        //回复@
        var fhN = '回复@'+fhName;
        //var oInput = $(this).parents('.date-dz-right').parents('.date-dz').siblings('.hf-con');
        var fhHtml = '<div class="hf-con pull-left"> <textarea class="content comment-input hf-input" placeholder="" onkeyup="keyUP(this)"></textarea> <a href="javascript:;" class="hf-pl">评论</a></div>';
        //显示回复
        if($(this).is('.hf-con-block')){
            $(this).parents('.date-dz-right').parents('.date-dz').append(fhHtml);
            $(this).removeClass('hf-con-block');
            $('.content').flexText();
            $(this).parents('.date-dz-right').siblings('.hf-con').find('.pre').css('padding','6px 15px');
            //console.log($(this).parents('.date-dz-right').siblings('.hf-con').find('.pre'))
            //input框自动聚焦
            $(this).parents('.date-dz-right').siblings('.hf-con').find('.hf-input').val('').focus().val(fhN);
        }else {
            $(this).addClass('hf-con-block');
            $(this).parents('.date-dz-right').siblings('.hf-con').remove();
        }
    });
</script>
<!--评论回复块创建-->
<script type="text/javascript">
    $('.comment-show').on('click','.hf-pl',function(){
        var oThis = $(this);
        var myDate = new Date();
        //获取当前年
        var year=myDate.getFullYear();
        //获取当前月
        var month=myDate.getMonth()+1;
        //获取当前日
        var date=myDate.getDate();
        var h=myDate.getHours();       //获取当前小时数(0-23)
        var m=myDate.getMinutes();     //获取当前分钟数(0-59)
        if(m<10) m = '0' + m;
        var s=myDate.getSeconds();
        if(s<10) s = '0' + s;
        var now=year+'-'+month+"-"+date+" "+h+':'+m+":"+s;
        //获取输入内容
        var oHfVal = $(this).siblings('.flex-text-wrap').find('.hf-input').val();
        arr = oHfVal.split(':');
        oHfVal=arr[1];
        console.log(oHfVal)
        var oHfName = $("#userName").text();
        var oAllVal = '回复@'+oHfName;
        var oHtml = '<div class="all-pl-con"><div class="pl-text hfpl-text clearfix"><a href="${pageContext.request.contextPath }/DownLoadController/download/?filename=${sessionScope.user.userImg}" class="comment-size-name">'+oAllVal+'</a><span class="my-pl-con">'+oHfVal+'</span></div><div class="date-dz"> <span class="date-dz-left pull-left comment-time">'+now+'</span> <div class="date-dz-right pull-right comment-pl-block"> <a href="javascript:;" class="removeBlock">删除</a> <a href="javascript:;" class="date-dz-pl pl-hf hf-con-block pull-left">回复</a> </div> </div></div>';
        oThis.parents('.hf-con').parents('.comment-show-con-list').find('.hf-list-con').css('display','block').prepend(oHtml) && oThis.parents('.hf-con').siblings('.date-dz-right').find('.pl-hf').addClass('hf-con-block') && oThis.parents('.hf-con').remove();
        var comId=$("#comId").text();
        var comments2 = {
            "com2Text": oHfVal,
            "com2Date":now,
        }
        $.ajax({
            url:"${pageContext.request.contextPath}/comments/addCom2",
            type:"GET",
            data:{comments2:JSON.stringify(comments2),comId:comId,userName:oHfName },
            dataType:"json",
        })

    });
</script>
<script type="text/javascript">
    $(function () {
        //发送ajax请求 获取其他房间
        $.ajax({
            async : true,
            type : "POST",
            url : "${pageContext.request.contextPath}/viewRoomInfo/getAllRoom",
            dataType:"json",
            success : function (data) {
                var content = "";
                //遍历
                $.each(data,function (index,obj) {
                    $("#otherRoomType").append( "<div class=\"grid\">\n" +
                        "                                    <div class=\"room-item\">\n" +
                        "                                        <img id='uimg'   src=\"${pageContext.request.contextPath }/DownLoadController/download/?filename="+obj.roomImg+"\" />\n" +
                        "                                        <div class=\"room-text-show\">\n" +
                        "                                            <h2>"+obj.rtName+"</h2>\n" +
                        "                                        </div>\n" +
                        "                                        <div class=\"room-text-hide\">\n" +
                        "                                            <h2>"+obj.rtName+"</h2>\n" +
                        "                                            <span>"+obj.roomNum+"</span>\n" +
                        "                                            <p style=\"display: -webkit-box;\n" +
                        "-webkit-box-orient: vertical;\n" +
                        "-webkit-line-clamp: 2;\n" +
                        "overflow: hidden;\">"+obj.remark+"</p>\n" +
                        "                                            <small>价钱: ￥<span>"+obj.rtPrice+"</span> / 晚</small>\n" +
                        "                                            <small>房间电话: <span>"+obj.roomTel+"</span></small>\n" +
                        "                                            <a class=\"theme-btn-s2\" href=\"${pageContext.request.contextPath}/frontController/roomSingle?rtName="+obj.rtName+"\">查看</a>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>")
                })
                //填充到指定的标签中
                /*$("#roomDiv").html(content);*/
            },
            error : function() {
                alert("异步请求失败~");
            }
        })
        /*$.ajax({
            url:"/RoomTypeController/queryOtherRoomType",
            type:"GET",
            data:{rtName:$("#rtName").text()},
            dataType:"json",
            success:function(data){
                for(var i=0;i<data.length;i++){
                    $("#otherRoomType").append("<div class=\"grid\">\n" +
                        "           <div class=\"room-item\">\n" +
                        "                <img id='uimg'   src=\"/DownLoadController/download/?filename="+data[i].roomImg+"\" />\n" +
                        "                <div class=\"room-text-show\">\n" +
                        "                      <h2>"+data[i].rtName+"</h2>\n" +
                        "                </div>\n" +
                        "                <div class=\"room-text-hide\">\n" +
                        "                      <h2>"+data[i].rtName+"</h2>\n" +
                        "                      <p style=\"display: -webkit-box;\n" +
                        "-webkit-box-orient: vertical;\n" +
                        "-webkit-line-clamp: 2;\n" +
                        "overflow: hidden;\">"+data[i].rtRemark+"</p>\n" +
                        "                       <small>价格: <span>"+data[i].rtPrice+"</span> / 晚</small>\n" +
                        "                      <a class=\"theme-btn-s2\" href=\"/frontController/roomSingle?rtName="+data[i].rtName+"\">了解更多</a>\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "        </div>\n")
                }

            }
        })*/
    })
</script>
</html>